<?php
define('ipos',true);
include("./include/config.php");
header ("content-type: text/xml");
$xml	=	"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n
<urlset xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd\" xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n
	<url>\n
		<loc>".MAIN_URL."</loc>\n
		<changefreq>hourly</changefreq>\n
		<priority>1.0</priority>\n
	</url>\n";

$sitemap	=	$db->database("phimid,tenphim,tentienganh","film","phimid > 0 ORDER BY phimtime DESC LIMIT 1000");
for($i=0;$i<count($sitemap);$i++) {
	$url_phim	=	url_link($sitemap[$i][1].'-'.$sitemap[$i][2],$sitemap[$i][0],'phim');
	$xml	.=	"<url>\n
					<loc>$url_phim</loc>\n
					<changefreq>monthly</changefreq>\n
					<priority>0.2</priority>\n
				</url>\n";
}
$xml	.=	"</urlset>";
echo $xml;
exit();
?>